home *** CD-ROM | disk | FTP | other *** search
- Path: anvil.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: Looking for semaphore example.
- Date: 2 Apr 1996 09:31:00 -0800
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4jro8kINN85c@anvil.ugrad.cs.ubc.ca>
- References: <4jc5hd$1vlv@ilx018.iil.intel.com> <4jlc0k$j02@solutions.solon.com> <828366149snz@genesis.demon.co.uk> <4jq01e$9kq@solutions.solon.com>
- NNTP-Posting-Host: anvil.ugrad.cs.ubc.ca
-
- In article <4jq01e$9kq@solutions.solon.com>,
- Peter Seebach <seebs@solutions.solon.com> wrote:
- >In article <828366149snz@genesis.demon.co.uk>,
- >Lawrence Kirby <fred@genesis.demon.co.uk> wrote:
- >>>Unless you wanted to implement software-level coprocesses or the like,
- >>>which you could do.
- >
- >>Strictly conforming?
- >
- >Sure. You could write strictly conforming C which parses and translates
- >one or more programs in an arbitrary language, and gives them various
- >"calls" they can make, which could include semaphores.
-
- Or how about this:
-
- #include <stdio.h>
-
- char *semprog =
- "#include <stdio.h>\n";
- "#include <semctl.h>\n";
- "int main()\n";
- "/* et cetera... code which uses semaphores */\n";
-
- int main()
-
- {
- FILE *f = fopen("semprog.c","w");
- if (f) {
- fputs(semprog, f);
- fclose(f);
- system("cc semprog.c");
- system("a.out");
- }
- return 0;
- }
- --
-
-